package com.chat.server.handler;

import com.chat.process.IMProcessor;
import com.chat.protocol.IMMessage;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author Chenjie
 * @Title: SocketHandler
 * @Package com.chat.server.handler
 * @Description:
 * @date 2017/12/11
 */
public class SocketHandler extends SimpleChannelInboundHandler<IMMessage> {
    private IMProcessor processor = new IMProcessor();

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, IMMessage msg) throws Exception {
        processor.process(ctx.channel(), msg);
    }
}
